package com.davidhigenbottam.HeatMap.client;

import com.google.gwt.core.client.JavaScriptObject;


public class KmlLayer {
	
	JavaScriptObject jsKMLOverlay;
	JavaScriptObject jsMap;
	boolean visible= true;
	
	public KmlLayer(JavaScriptObject jsKMLOverlay,JavaScriptObject jsMap) {
		super();
		this.jsKMLOverlay = jsKMLOverlay;
		this.jsMap = jsMap;
	}

	public void setVisible(boolean b) {
		if(b)
			nativeShow();
		else
			nativeHide();
		
		this.visible= b;
		
	}

//	public LatLngBounds getDefaultCenter() {
//		// TODO Auto-generated method stub
//		return null;
//	}

	public boolean isHidden() {
		
		return this.visible;
	}

	public JavaScriptObject getJsKMLOverlay() {
		return jsKMLOverlay;
	}

	public void setJsKMLOverlay(JavaScriptObject jsKMLOverlay) {
		this.jsKMLOverlay = jsKMLOverlay;
	}

	public native void nativeShow() /*-{
	this.@com.davidhigenbottam.HeatMap.client.KmlLayer::jsKMLOverlay.setMap(this.@com.davidhigenbottam.HeatMap.client.KmlLayer::jsMap);
}-*/;
	
	public native void nativeHide() /*-{
	this.@com.davidhigenbottam.HeatMap.client.KmlLayer::jsKMLOverlay.setMap(null);
}-*/;
		
}
